<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Checks if multiple results are available</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.odbc-longreadlen.html">odbc_longreadlen</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.odbc-num-fields.html">odbc_num_fields</a></div>
 <div class="up"><a href="ref.uodbc.html">ODBC 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.odbc-next-result" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">odbc_next_result</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.5, PHP 5)</p><p class="refpurpose"><span class="refname">odbc_next_result</span> &mdash; <span class="dc-title">Checks if multiple results are available</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.odbc-next-result-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>odbc_next_result</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$result_id</code></span>
   )</div>

  <p class="para rdfs-comment">
   Checks if there are more result sets available as well as allowing access
   to the next result set via <span class="function"><a href="function.odbc-fetch-array.html" class="function">odbc_fetch_array()</a></span>,
   <span class="function"><a href="function.odbc-fetch-row.html" class="function">odbc_fetch_row()</a></span>, <span class="function"><a href="function.odbc-result.html" class="function">odbc_result()</a></span>, etc.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.odbc-next-result-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">result_id</code></em></dt>

     <dd>

      <p class="para">
       The result identifier.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.odbc-next-result-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns <strong><code>TRUE</code></strong> if there are more result sets, <strong><code>FALSE</code></strong> otherwise.
  </p>
 </div>

 <div class="refsect1 examples" id="refsect1-function.odbc-next-result-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-868">
    <p><strong>Example #1 <span class="function"><strong>odbc_next_result()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$r_Connection&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">odbc_connect</span><span style="color: #007700">(</span><span style="color: #0000BB">$dsn</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$username</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$password</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$s_SQL&nbsp;</span><span style="color: #007700">=&nbsp;&lt;&lt;&lt;END_SQL<br /></span><span style="color: #DD0000">SELECT&nbsp;'A'<br />SELECT&nbsp;'B'<br />SELECT&nbsp;'C'<br /></span><span style="color: #007700">END_SQL;<br /><br /></span><span style="color: #0000BB">$r_Results&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">odbc_exec</span><span style="color: #007700">(</span><span style="color: #0000BB">$r_Connection</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$s_SQL</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$a_Row1&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">odbc_fetch_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$r_Results</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$a_Row2&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">odbc_fetch_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$r_Results</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #DD0000">"Dump&nbsp;first&nbsp;result&nbsp;set"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$a_Row1</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$a_Row2</span><span style="color: #007700">);<br /><br />echo&nbsp;</span><span style="color: #DD0000">"Get&nbsp;second&nbsp;results&nbsp;set&nbsp;"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">odbc_next_result</span><span style="color: #007700">(</span><span style="color: #0000BB">$r_Results</span><span style="color: #007700">));<br /><br /></span><span style="color: #0000BB">$a_Row1&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">odbc_fetch_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$r_Results</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$a_Row2&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">odbc_fetch_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$r_Results</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #DD0000">"Dump&nbsp;second&nbsp;result&nbsp;set&nbsp;"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$a_Row1</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$a_Row2</span><span style="color: #007700">);<br /><br />echo&nbsp;</span><span style="color: #DD0000">"Get&nbsp;third&nbsp;results&nbsp;set&nbsp;"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">odbc_next_result</span><span style="color: #007700">(</span><span style="color: #0000BB">$r_Results</span><span style="color: #007700">));<br /><br /></span><span style="color: #0000BB">$a_Row1&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">odbc_fetch_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$r_Results</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$a_Row2&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">odbc_fetch_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$r_Results</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #DD0000">"Dump&nbsp;third&nbsp;result&nbsp;set&nbsp;"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$a_Row1</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$a_Row2</span><span style="color: #007700">);<br /><br />echo&nbsp;</span><span style="color: #DD0000">"Try&nbsp;for&nbsp;a&nbsp;fourth&nbsp;result&nbsp;set&nbsp;"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">odbc_next_result</span><span style="color: #007700">(</span><span style="color: #0000BB">$r_Results</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Dump first result set array(1) {
  [&quot;A&quot;]=&gt;
  string(1) &quot;A&quot;
}
bool(false)
Get second results set bool(true)
Dump second result set array(1) {
  [&quot;B&quot;]=&gt;
  string(1) &quot;B&quot;
}
bool(false)
Get third results set bool(true)
Dump third result set array(1) {
  [&quot;C&quot;]=&gt;
  string(1) &quot;C&quot;
}
bool(false)
Try for a fourth result set bool(false)
</pre></div>
    </div>
   </div>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.odbc-longreadlen.html">odbc_longreadlen</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.odbc-num-fields.html">odbc_num_fields</a></div>
 <div class="up"><a href="ref.uodbc.html">ODBC 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
